package com.oyo.common.enums;

/**
 * @Author: ywj
 * @Description:
 * @Date: 2018/9/7 11:37
 */
public enum RoomStatus {
    CLEAN_ROOM(10, "干净房"),

    DIRTY_ROOM(11, "脏房"),

    WAIT_CHECK_IN(20, "待入住"),

    LIVING(21, "在住"),

    STOP_SALE(30, "停售");
    int code;
    String name;

    RoomStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(int code) {
        RoomStatus[] types = values();
        for (RoomStatus type : types) {
            if (type.getCode() == code) {
                return type.getName();
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
